﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package Classes.MiniQuest {
    import flash.events.*;
    import Engine.Managers.*;
    import Display.*;
    import Modules.stats.types.*;

    public class DailyBonusMQ extends MiniQuest {

        public static const QUEST_NAME:String = "dailyBonusMQ";

        public function DailyBonusMQ(){
            super(QUEST_NAME);
            m_recurrenceTime = 4;
        }
        public static function doDailyBonus():void{
            Global.player.dailyBonusManager.collectDailyBonus();
            if (Global.player.dailyBonusManager.isLastDay()){
                UI.freezeScreen(true);
            } else {
                Global.player.dailyBonusManager.doBonusEndTasks();
            };
        }

        override protected function initQuest():void{
            if (((m_assetsLoaded) && (!(m_questActive)))){
                StatsManager.count(StatsCounterType.DAILY_BONUS, "iconTriggered");
            };
            super.initQuest();
        }
        override protected function onIconClicked(_arg1:MouseEvent):void{
            super.onIconClicked(_arg1);
            doDailyBonus();
            m_recurrenceTime = 0;
        }

    }
}//package Classes.MiniQuest 
